<template>
  <div>
    <div style="background:#ECECEC; padding:30px;height: 100%">
      <a-card :bordered="false" title="重置密码" style="width: 300px;margin: auto;height:300px">
        <a-input v-model="email" prefix="📫" placeholder="邮箱" size="large"/>

        <br>
        <br>

        <a-button @click="resetPass" type="primary" block class="input" style="height: 40px">
          重置
        </a-button>
      </a-card>
    </div>
  </div>
</template>

<script>
  import {resetPassword} from '../api/api'
    export default {
        name: "ResetPassword",
        data(){
            return {
                email:""
            }
        },
        methods:{
            resetPass(){
                let email = this.email;
                resetPassword({email:email}).then((res)=>{
                    if(res.data.data.code==200){
                        this.$message.success(res.data.data.msg)
                    }else{
                        if(res.data.data.code==msg){
                            this.$message.error(res.data.data.msg);
                            return;
                        }
                        this.$message.error("重置失败")
                    }

                })
            }
        }
    }
</script>

<style scoped>

</style>
